﻿using Aierp.Entities;
using Aierp.Utility.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Aierp.SystemEntities.System;

namespace Aierp.Repository
{
    /// <summary>
    /// 用户管理仓储接口
    /// </summary>
    public interface IUserRepository
    {
        /// <summary>
        /// 用户登录方法
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>成功1，失败0,用户禁用-2</returns>
        int Login(string userName, string password, SysVisitor sysVisitor);

        int Add(Sys_Users item);
        string GetList(string order, int limit, int offset,string searchTxt);
        Sys_Users Find(string key);
        object FindById(int key);
        int Remove(int key);
        int Update(Sys_Users item);
        int UpdateMyInfo(Sys_Users item);
        bool CheckUser(SysVisitor sysVisitor);
        int ChangePassWord(int userId, string oldPass, string newPass);
        int ResetPassWord(int userId);

        int GetHtmlVersion();
    }
}
